package com.aphrodite.util;

public interface CharacterIterator {
	public static final char DONE = 65535;

	public char current();

	public char first();

	/**
	 * Get the starting index
	 * 
	 * @return
	 */
	public int getBeginIndex();

	/**
	 * Get the ending index
	 * 
	 * @return
	 */
	public int getEndIndex();

	/**
	 * Get the current character pointer position
	 * 
	 * @return
	 */
	public int getIndex();

	/**
	 * Set the character pointer to the last and return the last character
	 * 
	 * @return
	 */
	public char last();

	/**
	 * Get the next character
	 * 
	 * @return
	 */
	public char next();

	/**
	 * Previous character
	 * 
	 * @return
	 */
	public char previous();

	/**
	 * Set the current character pointer index
	 * 
	 * @param i
	 * @return
	 */
	public char setIndex(int i);

	/**
	 * @return a substring
	 */
	String substring(int offset, int length);

	/**
	 * @return a substring
	 */
	String substring(int offset);

	/**
	 * @return a character at the specified position.
	 */
	char charAt(int index);

	/**
	 * checks if the specified index is after the end of the character stream
	 * 
	 * @param pos
	 * @return
	 */
	public boolean isEnd(int pos);
}
